# Replication Code for "Vote Switching in Multiparty Presidential Systems: Evidence from the Argentine 
# Chamber of Deputies" (Supplementary materials)

# Table B
hux_sectoral_time <- as_huxtable(ss_sectoral_time)
quick_docx(hux_sectoral_time,
           file = "huxtablesectoral_time.docx",
           borders = 0.4, open = interactive())
hux_sectoral_time_desfav <- as_huxtable(ss_sectoral_time_desfav)
quick_docx(hux_sectoral_time_desfav,
           file = "huxtablesectoral_time_desfav.docx",
           borders = 0.4, open = interactive())

# Table C
hux_ss_amendments_time <- as_huxtable(ss_amendments_time)
quick_docx(hux_ss_amendments_time ,
           file = "huxtableamendments_time_desfav.docx",
           borders = 0.4, open = interactive())

# Figure A
ss_amendments_time <- sim_slopes(m3_desfav, pred = con_modif, modx = log_dias, 
                                 modx.values = c(2.079442,2.7080502,3.4011974,5.1929569))
plot(ss_amendments_time,
     ci_level = 0.95, x.label = "Slope of amendments",
     model.names = "Unfavorable switching", colors = "black")


# Figure B
cat_plot(m5, pred = type_legis, modx = sectoriales, point.shape = TRUE, interval = TRUE, 
         vary.lty = TRUE, x.label = "Type of legislator", y.label = "Total switching",
         modx.labels = c("Non-sectoral bill", "Sectoral bill"), 
         line.thickness = 0.5, errorbar.width = 0.4,legend.main = "", colors = c("#8c8c8c","black"))